using System;
using System.Collections.Generic;
using OracleInternal.Common;

namespace OracleInternal.Network
{
	internal class ConnectionOption : ICloneable
	{
		internal delegate void AsyncReceiveCallback(byte[] buf, int length);

		internal static readonly int NSPDFSDULN = 65535;

		internal static readonly int NSPDFTDULN = 65535;

		internal static readonly int NSPMNSDULN = 512;

		internal static readonly int NSPMNTDULN = 255;

		internal static readonly int NSPOLDMXSDULN = 65535;

		internal static readonly int NSPOLDMXTDULN = 65535;

		internal static readonly int NSPMXSDULN = 65535;

		internal static readonly int NSPMXTDULN = 65535;

		internal static readonly int NSPINSDULN = 255;

		internal int m_portNumber = -1;

		private int m_TDUSize;

		private int m_SDUSize;

		private int m_transportConnectTO = -1;

		private string m_protocol;

		private string m_host;

		private string m_IP;

		private int m_SBS;

		private int m_RBS;

		private string m_sid;

		private string m_addr;

		private string m_server;

		private string m_service_name;

		private string m_instance_name;

		private string m_conn_data;

		private string m_https_proxy;

		private int m_https_proxy_port = 80;

		private string m_websock_uri;

		private bool m_inAddr_Any;

		internal bool READONLY_CHUNK_OK;

		internal List<EZConnect.HostPort> HostPortPairs;

		internal int Retries;

		internal int RetryDelay;

		private string m_ssl_version = "";

		private string m_wallet_directory = "";

		private string m_sslServerDN = "";

		private bool? m_sslServerDNMatching;

		internal object AsyncBufferInitArg;

		internal ConOraBufPool AsyncBufferPool;

		internal bool m_KeepAlive;

		internal int m_KeepAliveTime;

		internal int m_KeepAliveInterval;

		internal string m_encryption;

		internal string m_encryption_types;

		internal string m_crypto_checksum;

		internal string m_crypto_checksum_types;

		internal SqlNetOraConfig m_SNOConfig;

		internal bool OnRedirect;

		internal SqlNetOraConfig SNOConfig
		{
			get
			{
				return m_SNOConfig;
			}
			set
			{
				m_SNOConfig = value;
				SetSBSRBS();
			}
		}

		internal string Encryption
		{
			get
			{
				return m_encryption;
			}
			set
			{
				m_encryption = value;
			}
		}

		internal string EncryptionTypes
		{
			get
			{
				return m_encryption_types;
			}
			set
			{
				m_encryption_types = value;
			}
		}

		internal string CryptoChecksum
		{
			get
			{
				return m_crypto_checksum;
			}
			set
			{
				m_crypto_checksum = value;
			}
		}

		internal string CryptoChecksumTypes
		{
			get
			{
				return m_crypto_checksum_types;
			}
			set
			{
				m_crypto_checksum_types = value;
			}
		}

		internal bool KeepAlive
		{
			get
			{
				return m_KeepAlive;
			}
			set
			{
				m_KeepAlive = value;
			}
		}

		internal int KeepAliveTime
		{
			get
			{
				return m_KeepAliveTime;
			}
			set
			{
				m_KeepAliveTime = value;
			}
		}

		internal int KeepAliveInterval
		{
			get
			{
				return m_KeepAliveInterval;
			}
			set
			{
				m_KeepAliveInterval = value;
			}
		}

		internal bool inAddr_Any
		{
			get
			{
				return m_inAddr_Any;
			}
			set
			{
				m_inAddr_Any = value;
			}
		}

		internal string SSL_Version
		{
			get
			{
				return m_ssl_version;
			}
			set
			{
				m_ssl_version = value;
			}
		}

		internal string SSL_WALLET_DIRECTORY
		{
			get
			{
				return m_wallet_directory;
			}
			set
			{
				m_wallet_directory = value;
			}
		}

		internal string SSLServerDN
		{
			get
			{
				return m_sslServerDN;
			}
			set
			{
				m_sslServerDN = value;
			}
		}

		internal bool? SSLServerDNMatching
		{
			get
			{
				return m_sslServerDNMatching;
			}
			set
			{
				m_sslServerDNMatching = value;
			}
		}

		internal string IP
		{
			get
			{
				return m_IP;
			}
			set
			{
				m_IP = value;
			}
		}

		internal int SBS
		{
			get
			{
				return m_SBS;
			}
			set
			{
				m_SBS = value;
			}
		}

		internal int RBS
		{
			get
			{
				return m_RBS;
			}
			set
			{
				m_RBS = value;
			}
		}

		internal int Port
		{
			get
			{
				return m_portNumber;
			}
			set
			{
				m_portNumber = value;
			}
		}

		internal int TransportDataUnitSize
		{
			get
			{
				return m_TDUSize;
			}
			set
			{
				m_TDUSize = value;
			}
		}

		internal int TransportConnectTO
		{
			get
			{
				return m_transportConnectTO;
			}
			set
			{
				m_transportConnectTO = value;
			}
		}

		internal int SessionDataUnitSize
		{
			get
			{
				return m_SDUSize;
			}
			set
			{
				m_SDUSize = value;
			}
		}

		internal string Protocol
		{
			get
			{
				return m_protocol;
			}
			set
			{
				m_protocol = value;
			}
		}

		internal string Host
		{
			get
			{
				return m_host;
			}
			set
			{
				m_host = value;
			}
		}

		internal string SID
		{
			get
			{
				return m_sid;
			}
			set
			{
				m_sid = value;
			}
		}

		internal string Server
		{
			get
			{
				return m_server;
			}
			set
			{
				m_server = value;
			}
		}

		internal string ServiceName
		{
			get
			{
				return m_service_name;
			}
			set
			{
				m_service_name = value;
			}
		}

		internal string InstanceName
		{
			get
			{
				return m_instance_name;
			}
			set
			{
				m_instance_name = value;
			}
		}

		internal string Address
		{
			get
			{
				return m_addr;
			}
			set
			{
				m_addr = value;
			}
		}

		internal string ConnectData
		{
			get
			{
				return m_conn_data;
			}
			set
			{
				m_conn_data = value;
			}
		}

		internal string HTTPS_PROXY
		{
			get
			{
				return m_https_proxy;
			}
			set
			{
				m_https_proxy = value;
			}
		}

		internal int HTTPS_PROXY_PORT
		{
			get
			{
				return m_https_proxy_port;
			}
			set
			{
				m_https_proxy_port = value;
			}
		}

		internal string WEBSOCK_URI
		{
			get
			{
				return m_websock_uri;
			}
			set
			{
				m_websock_uri = value;
			}
		}

		public ConnectionOption Clone()
		{
			return (ConnectionOption)MemberwiseClone();
		}

		object ICloneable.Clone()
		{
			return Clone();
		}

		internal ConnectionOption(SqlNetOraConfig SNOConfig = null)
		{
			m_SDUSize = NSPDFSDULN;
			m_TDUSize = NSPDFTDULN;
			if (SNOConfig == null)
			{
				SNOConfig = new SqlNetOraConfig(ConfigBaseClass.m_configParameters);
			}
			m_SNOConfig = SNOConfig;
			SetSBSRBS();
		}

		private void SetSBSRBS()
		{
			m_SBS = m_SNOConfig.SendBufSize;
			m_RBS = m_SNOConfig.RecvBufSize;
		}
	}
}
